﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace Genko.Model.Integration
{
	public abstract class AbstractMemberReader : IMemberReader
	{
		protected AbstractMemberReader()
		{
			
		}

		public abstract IMemberReader OwnerReader
		{
			get;
		}

		public abstract Guid? GUID
		{
			get;
		}

		public abstract string TagName
		{
			get;
		}

		public abstract string Value
		{
			get;
		}

		public abstract int MemberCount
		{
			get;
		}

		public abstract Dictionary<string, string> ReadAttributes();

		public abstract IMemberReader ReadMember(int index);
		
		IEnumerator<IMemberReader> IEnumerable<IMemberReader>.GetEnumerator()
		{
			List<IMemberReader> list = new List<IMemberReader>(this.MemberCount);
			for (int i = 0; i < this.MemberCount; i++) {
				list.Add(this.ReadMember(i));
			}
			return list.GetEnumerator();
		}
		
		IEnumerator IEnumerable.GetEnumerator()
		{
			IEnumerator<IMemberReader> enumerator = ((IEnumerable<IMemberReader>) this).GetEnumerator();
			return enumerator;
		}
	}
}
